﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Telerik.Web.Mvc;

namespace CardInChina.Web.Mvc.Controllers
{
    public class SampleController : CICBasicController
    {

        [GridAction]
        public ActionResult _GetSampleData()
        {
            var r = new Random();

            var fakeData = new[] { 
                new { Id=10040, Title="样本数据10040", Date=DateTime.Now.AddHours(-1), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10041, Title="样本数据10041", Date=DateTime.Now.AddHours(-2), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10042, Title="样本数据10042", Date=DateTime.Now.AddHours(-3), State="Disabled", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10043, Title="样本数据10043", Date=DateTime.Now.AddHours(-4), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10044, Title="样本数据10044", Date=DateTime.Now.AddHours(-5), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10045, Title="样本数据10045", Date=DateTime.Now.AddHours(-6), State="Disabled", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10046, Title="样本数据10046", Date=DateTime.Now.AddHours(-7), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10047, Title="样本数据10047", Date=DateTime.Now.AddHours(-8), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10048, Title="样本数据10048", Date=DateTime.Now.AddHours(-9), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10049, Title="样本数据10049", Date=DateTime.Now.AddHours(-10), State="Disabled", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10050, Title="样本数据10050", Date=DateTime.Now.AddHours(-11), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10051, Title="样本数据10051", Date=DateTime.Now.AddHours(-12), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10052, Title="样本数据10052", Date=DateTime.Now.AddHours(-13), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10053, Title="样本数据10053", Date=DateTime.Now.AddHours(-14), State="Disabled", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10054, Title="样本数据10054", Date=DateTime.Now.AddHours(-15), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10055, Title="样本数据10055", Date=DateTime.Now.AddHours(-16), State="Normal", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
                new { Id=10056, Title="样本数据10056", Date=DateTime.Now.AddHours(-17), State="Disabled", Email="chrisgreen@microsoft.com", Data1=r.Next(1000000,10000000), Data2="", Data3=r.Next(20,150), Data4=r.Next(1,99) },
            };
            var model = new GridModel(fakeData);
            return View(model);
        }
         

    }
}
